package jwebtester.business.services;

import java.util.concurrent.ConcurrentHashMap;

import domain.entities.Competency;

/**
 * Service for caching competencies tree. Concrete implementations should cache
 * the whole hierarchy as much as possible
 * 
 * @author tillias
 * 
 */
public interface CompetenciesService {

	/**
	 * Gets whole tree of competencies for given organization
	 * 
	 * @param forceRefresh
	 *            Specifies whether cached copy should be used or tree should be
	 *            loaded directly from DB
	 * @return Tree of competencies with fake root node
	 */
	Competency getHierarchy(int organizationID, boolean forceRefresh);

	/**
	 * Gets mapping from competency identifier to the expanded status of the
	 * corresponding tree node
	 */
	ConcurrentHashMap<Integer, Boolean> getExpandedNodesMap();
}
